﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FrameDisplayServer.Browser;
using System.Windows.Forms;
using FrameDisplayServer.Services;

namespace FrameDisplayServer
{
    public static class AppCentral
    {
        private static AppCentralConfiguration s_config = null;

        public static bool IsInitialized
        {
            get { return s_config != null; }
        }

        public static void Initialize(AppCentralConfiguration config)
        {
            s_config = config;
        }

        public static Form MainForm
        {
            get { return s_config.MainForm; }
        }

        public static IServiceManager ServiceManager
        {
            get { return s_config.ServiceManager; }
        }

        public static ISettingsManager SettingsManager
        {
            get { return s_config.SettingsManager; }
        }

        public static IBrowserManager BrowserManager
        {
            get { return s_config.BrowserManager; }
        }
    }

    public class AppCentralConfiguration
    {
        private Form mainForm;
        private IServiceManager serviceManager;
        private ISettingsManager settingsManager;
        private IBrowserManager browserManager;

        public Form MainForm
        {
            get { return this.mainForm; }
            set { this.mainForm = value; }
        }

        public IServiceManager ServiceManager
        {
            get { return this.serviceManager; }
            set { this.serviceManager = value; }
        }

        public ISettingsManager SettingsManager
        {
            get { return this.settingsManager; }
            set { this.settingsManager = value; }
        }

        public IBrowserManager BrowserManager
        {
            get { return this.browserManager; }
            set { this.browserManager = value; }
        }
    }
}
